﻿using System;
using System.Collections.Generic;
using System.Text;
using GroupChat2013.Plugins;
using System.Drawing;
using System.Windows.Forms;
using AboutPlugin.Properties;

namespace AboutPlugin
{
    public class AboutPlugin : IPlugin
    {
        private FrmAbout m_FrmAbout;

        public Image IconImage
        {
            get { return Resources._default; }
            set { }
        }

        public string Description { get { return "关于"; } }

        public void Execute(PluginContext context)
        {
            //如果窗体未创建或者已经释放
            if (m_FrmAbout == null || m_FrmAbout.IsDisposed)
            {
                m_FrmAbout = new FrmAbout();
            }

            m_FrmAbout.Show();
            m_FrmAbout.WindowState = FormWindowState.Normal;
            WinAPI.SetActiveWindow(m_FrmAbout.Handle);
        }

        public int Order
        {
            get { return 1; }
        }

        /// <summary>
        /// 插件名称
        /// </summary>
        public string Name { get { return "AboutPlugin"; } }
    }
}
